<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Hash;
use DB;
use App\Http\Requests;
use App\Http\Controllers\Controller;

class DetailController extends Controller
{
	public function getDetail($id)
	{

    //根据景点id查询景点信息
	//查询景点详情
	$scenic = DB::table('scenic')->where('id',$id)->first();
	//查询景点图片及文本
	$photo = DB::table('scenic_photo')->where('sid',$id)->get();
	//查询景点评论
	$comment = DB::table('comment')->where('sid',$id)->get();
	// dd($photo);
	// var_dump($scenic);
	// var_dump($photo);
	return view('home.detail.detail',['scenic' => $scenic,'photo'=>$photo,'comment'=>$comment]);

	//查询数据显示
	
	}

}
